<template>
	<view class="bg-gradual-blue ">
		<cu-custom bgColor="">
			<block slot="content">流程管理系统</block>
		</cu-custom>
		
		<view class="padlr3">
			<swiper class="screen-swiper round5 bdso bdcf shadow3 bdw1" :indicator-dots="true" :circular="true"
			 :autoplay="true" interval="5000" duration="500">
				<swiper-item class=" round5" v-for="(item,index) in swiperList" :key="index">
					<image class=" round5" :src="$api.aroot() + item.pic" mode="aspectFill" ></image>
					<!-- <video :src="item.url" autoplay loop muted :show-play-btn="false" :controls="false" objectFit="cover" v-if="item.type=='video'"></video> -->
				</swiper-item>
			</swiper>
		</view>
		
		<view class="flrc padb5 padt5">
			<view class="flcc flex1">
				<view class="fs30">{{day}}</view>
				<view class="text-sm">今日订单</view>
			</view>
			<view class="flcc flex1">
				<view class="fs30">{{week}}</view>
				<view class="text-sm">本周订单</view>
			</view>
			<view class="flcc flex1">
				<view class="fs30">{{month}}</view>
				<view class="text-sm">本月订单</view>
			</view>
		</view>
		<view class="bcf padt3">
			<view class="list-style-1 c11 martb3">生产工序</view>
			<view class="flex-r flex flex-wrap pad3 bc13">
				<view class="round5 pad2 mart3 ripple" style="width: 48%;" :class="'bc0' + (index%7 + 1 )" v-for="item,index in list"
				data-url="/pages/stream/wok/wok"  
				@tap="$win.navto"
				:data-id="item.id"
				>
					<view class="flrc bcf c11 martb2 padtb1 round30 padl3">
						<view class="flex1 fs12 fwb">{{item.name}}</view>
					</view>
					<view class="padb2 fs8 mart5">责任部门：{{item.department.name}}</view>
					<view class="padb2 fs8">责任经理：{{item.manageBy.name}}</view>
				
					<view class="tar mart2">
						<view class="cu-btn line-orange sm c13 round" > >> 生产情况</view>
					</view>
				</view>
			</view>
			<!-- <view class="bg-gradual-blue round5 shadow3 marlr3 pad2 mart5" v-for="item,index in list">
				<view class="flrc bcf c11 martb3 padtb2 round2 padl3">
					<view class="flex1 fs18">STEP{{item.sort}}. {{item.name}}</view>
				</view>
				<view class="padl10 padb2">责任部门：{{item.department.name}}</view>
				<view class="padl10 padb2">责任经理：{{item.manageBy.name}}</view>
				<view class="padl10 padb2">联系电话：{{item.manageBy.phone}}</view>

				<view class="tar">
					<view class="cu-btn bg-yellow c13 round ripple" 
					data-url="/pages/stream/wok/wok"  
					@tap="$win.navto"
					:data-id="item.id">>> 生产情况</view>
				</view>
			</view> -->
			<view>
				<view class="list-style-1 c11 martb3">信息</view>
				<view v-for="item,index in art">
					<view class="cu-card case no-card mart1" data-url="/pages/stream/artInfo/artInfo"  
					@tap="$win.navto"
					:data-id="item.id">
						<view class="cu-item shadow">
							<view class="image">
								<image :src="$api.getAssetBaseUrl() + item.cover" mode="widthFix"></image>
								<!-- <view class="cu-tag bg-blue">史诗</view> -->
								<!-- <view class="cu-bar bg-shadeBottom"> 
								<text class="text-cut">
									{{item.title}}
								</text>
								</view> -->
							</view>
							<view class="cu-list menu-avatar">
								<view class="cu-item">
									<!-- <view class="cu-avatar round lg" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg);"></view> -->
									<view class="flex-sub lh2 padlr5">
										<view class="text-grey">【{{item.category.name}}】{{item.title}}</view>
										<view class="text-gray text-sm flex justify-between">
											{{$com.str2time(item.createAt)}}
											<view class="text-gray text-sm">
												<text class="cuIcon-attentionfill margin-lr-xs"></text> {{item.numView}}
										<!-- 		<text class="cuIcon-appreciatefill margin-lr-xs"></text> 20
												<text class="cuIcon-messagefill margin-lr-xs"></text> 30 -->
											</view>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="pad3 tac bcf">
			<view class="bdtda bdc12 padt3 c12 fs8 op7">我是有底线的</view>
		</view>
	</view>
</template>

<script>
	import api from '../../../static/js/api.js'
	import com from '../../../static/js/com.js'
	import win from '../../../static/js/win.js'
	import list from '../../../static/js/list.js'
	export default {

		data() {
			return {
				list: [],
				art: [],
				swiperList:[],
				day:0,
				week:0,
				month:0,
			}
		},
		methods: {

			createOrder() {

			}
		},
		created() {
			this.$api.get('/api/streamPoints',{},(res) => {
				console.log(res)
				this.list = res.d
			})
			this.$api.get('/api/banners',{},(res) => {
				console.log(res)
				this.swiperList = res.d
			})
			let _this = this
			list.setUrl('/api/articles')
			list.setData({})
			list.setCbFunc((res) => {
				console.log(res)
				this.art = res
			})
			list.reload()
			
			
			this.$api.get('/admin/Stream/welcome',{},(res)=>{
				console.log(res)
				this.day = res.d.order.day
				this.week = res.d.order.week
				this.month = res.d.order.month
			})
			
		},
		onShow() {

		},
		onReachBottom() {
			list.getList()
		},
		onPullDownRefresh() {
			list.reload()
		}
	}
</script>

<style>

</style>
